import { useEffect } from 'react';

const useComponentWillUnMount = (unMountHandler) => {
  useEffect(() => {
    return () => unMountHandler();
  }, []);
};

export default useComponentWillUnMount;
